check if triplet exists in array